home *** CD-ROM | disk | FTP | other *** search
- Amiga Support Library documentation
-
-
- 680x0 coding: Neil O'Rourke
- Ideas and nagging: Roy "The Rat" Hurley
-
-
- Version 1.1 (28/4/94)
-
-
- This library is simply to give the average user some commands to make life
- that little bit easier. Have you ever asked Exec to
- AllocMem_($c8000,#MEMF_FAST) - thats 800k of memory! I have, and when the
- program exited on me by accident, that memory couldn't be reclaimed! Enter
- AllocMem and FreeMem. They do exactly the same job, but if you forget to
- free up the memory, Blitz will do it for you at the end.
-
- Other commands in the library have their origins with Roy Hurley. He
- generally nagged me into adding BLoad and BSave. The SearchString routine
- came from one of Roy's articles in ACAR, I just squeezed it into my
- library.
-
-
- Basic Commands
- ~~~~~~~~~~~~~~
-
- This library contains the following commands:
-
-
- MemoryBlock=AllocMem(ByteSize,Requirements)
- (long) (long) (long)
-
- This routine simply calles the Blitz AllocMem() routine so that any memory
- blocks allocated with it are freed when the program ends (if not already
- freed) or if the program aborts (during development of course :)
-
-
- FreeMem MemoryBlock,ByteSize
- (long) (long)
-
- Deallocates memory obtained with AllocMem
-
-
- result=IsEven(Expression)
- (bool) (byte,word,long)
-
- Returns true if Expression is even. Of use when requesting a value from a
- user that MUST be even.
-
-
- result=SearchString(StringPointer,StartAddress,BlockLength)
- (long) (&string) (long) (long)
-
- Finds a string in the given memory block and returns its address. Returns
- False otherwise.
-
-
- BLoad(FileName$,MemoryType)
-
- Loads the named file into memory, which can be selected, eg #MEMF_CHIP,
- #MEMF_FAST. Set this flag to 0 if you don't care. This function returns
- either 0 or an address of a newtype, pointing to two longwords. The first
- word is the file's location in memory, the second it the file's size.
- Don't loose this address!
-
- In the event of an error, just call IoErr_() to find out what happened.
-
- bugs: Don't ask for #MEMF_CLEAR. The Blitz AllocMem doesn't like it.
- This is not my problem! Get onto Simon to have this extended.
-
-
- BSave FileName$,Address,Size
-
- Save the named file out.
-
-
- BFree AddressReturnedFromBLoad
-
- Frees both the file that has been loaded and the newtype created.
-